import React, { useState,useEffect } from "react";



function App() {
  let [opacity,setOpacity] = useState(1)
  useEffect(()=>{
   const id= setInterval(()=>{
      opacity-=0.1
      if(opacity<=0){
        opacity = 1
      }
      setOpacity(opacity=opacity)
    },1000)
    return ()=>{
      clearInterval(id)
    }
  },[])
  return (
    <div>
      <h1 style={{opacity}}>我们的故事还没有落幕...</h1>
      
    </div>
  )
}

export default App;
